<?php
	/**
	 * This is a MetaControl class, providing a QForm or QPanel access to event handlers
	 * and QControls to perform the Create, Edit, and Delete functionality
	 * of the ProjectGallery class.  This code-generated class
	 * contains all the basic elements to help a QPanel or QForm display an HTML form that can
	 * manipulate a single ProjectGallery object.
	 *
	 * To take advantage of some (or all) of these control objects, you
	 * must create a new QForm or QPanel which instantiates a ProjectGalleryMetaControl
	 * class.
	 *
	 * Any and all changes to this file will be overwritten with any subsequent
	 * code re-generation.
	 *
	 * @package flx_qcubed
	 * @subpackage MetaControls
	 * @property-read ProjectGallery $ProjectGallery the actual ProjectGallery data class being edited
	 * @property QLabel $IdControl
	 * @property-read QLabel $IdLabel
	 * @property QListBox $ProjectIdControl
	 * @property-read QLabel $ProjectIdLabel
	 * @property QTextBox $DescriptionControl
	 * @property-read QLabel $DescriptionLabel
	 * @property QTextBox $InternalControl
	 * @property-read QLabel $InternalLabel
	 * @property QTextBox $UrlControl
	 * @property-read QLabel $UrlLabel
	 * @property QTextBox $SecureUrlControl
	 * @property-read QLabel $SecureUrlLabel
	 * @property QTextBox $ThumbUrlControl
	 * @property-read QLabel $ThumbUrlLabel
	 * @property QIntegerTextBox $WidthControl
	 * @property-read QLabel $WidthLabel
	 * @property QIntegerTextBox $HeightControl
	 * @property-read QLabel $HeightLabel
	 * @property QTextBox $FormatControl
	 * @property-read QLabel $FormatLabel
	 * @property QIntegerTextBox $SizeControl
	 * @property-read QLabel $SizeLabel
	 * @property QTextBox $LogUserControl
	 * @property-read QLabel $LogUserLabel
	 * @property QDateTimePicker $LogInsertControl
	 * @property-read QLabel $LogInsertLabel
	 * @property QLabel $LogUpdateControl
	 * @property-read QLabel $LogUpdateLabel
	 * @property-read string $TitleVerb a verb indicating whether or not this is being edited or created
	 * @property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
	 */

	class ProjectGalleryMetaControlGen extends QBaseClass {
		// General Variables
		/**
		 * @var ProjectGallery objProjectGallery
		 * @access protected
		 */
		protected $objProjectGallery;
		/**
		 * @var QForm|QControl objParentObject
		 * @access protected
		 */
		protected $objParentObject;
		/**
		 * @var string strTitleVerb
		 * @access protected
		 */
		protected $strTitleVerb;
		/**
		 * @var boolean blnEditMode
		 * @access protected
		 */
		protected $blnEditMode;

		// Controls that allow the editing of ProjectGallery's individual data fields
		/**
		 * @var QLabel lblId
		 * @access protected
		 */
		protected $lblId;
		/**
		 * @var QListBox lstProject
		 * @access protected
		 */
		protected $lstProject;
		/**
		 * @var QTextBox txtDescription
		 * @access protected
		 */
		protected $txtDescription;
		/**
		 * @var QTextBox txtInternal
		 * @access protected
		 */
		protected $txtInternal;
		/**
		 * @var QTextBox txtUrl
		 * @access protected
		 */
		protected $txtUrl;
		/**
		 * @var QTextBox txtSecureUrl
		 * @access protected
		 */
		protected $txtSecureUrl;
		/**
		 * @var QTextBox txtThumbUrl
		 * @access protected
		 */
		protected $txtThumbUrl;
		/**
		 * @var QIntegerTextBox txtWidth
		 * @access protected
		 */
		protected $txtWidth;
		/**
		 * @var QIntegerTextBox txtHeight
		 * @access protected
		 */
		protected $txtHeight;
		/**
		 * @var QTextBox txtFormat
		 * @access protected
		 */
		protected $txtFormat;
		/**
		 * @var QIntegerTextBox txtSize
		 * @access protected
		 */
		protected $txtSize;
		/**
		 * @var QTextBox txtLogUser
		 * @access protected
		 */
		protected $txtLogUser;
		/**
		 * @var QDateTimePicker calLogInsert
		 * @access protected
		 */
		protected $calLogInsert;
		/**
		 * @var QLabel lblLogUpdate
		 * @access protected
		 */
		protected $lblLogUpdate;

		// Controls that allow the viewing of ProjectGallery's individual data fields
		/**
		 * @var QLabel lblProjectId
		 * @access protected
		 */
		protected $lblProjectId;
		/**
		 * @var QLabel lblDescription
		 * @access protected
		 */
		protected $lblDescription;
		/**
		 * @var QLabel lblInternal
		 * @access protected
		 */
		protected $lblInternal;
		/**
		 * @var QLabel lblUrl
		 * @access protected
		 */
		protected $lblUrl;
		/**
		 * @var QLabel lblSecureUrl
		 * @access protected
		 */
		protected $lblSecureUrl;
		/**
		 * @var QLabel lblThumbUrl
		 * @access protected
		 */
		protected $lblThumbUrl;
		/**
		 * @var QLabel lblWidth
		 * @access protected
		 */
		protected $lblWidth;
		/**
		 * @var QLabel lblHeight
		 * @access protected
		 */
		protected $lblHeight;
		/**
		 * @var QLabel lblFormat
		 * @access protected
		 */
		protected $lblFormat;
		/**
		 * @var QLabel lblSize
		 * @access protected
		 */
		protected $lblSize;
		/**
		 * @var QLabel lblLogUser
		 * @access protected
		 */
		protected $lblLogUser;
		/**
		 * @var QLabel lblLogInsert
		 * @access protected
		 */
		protected $lblLogInsert;

		// QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References

		// QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References


		/**
		 * Main constructor.  Constructor OR static create methods are designed to be called in either
		 * a parent QPanel or the main QForm when wanting to create a
		 * ProjectGalleryMetaControl to edit a single ProjectGallery object within the
		 * QPanel or QForm.
		 *
		 * This constructor takes in a single ProjectGallery object, while any of the static
		 * create methods below can be used to construct based off of individual PK ID(s).
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this ProjectGalleryMetaControl
		 * @param ProjectGallery $objProjectGallery new or existing ProjectGallery object
		 */
		 public function __construct($objParentObject, ProjectGallery $objProjectGallery) {
			// Setup Parent Object (e.g. QForm or QPanel which will be using this ProjectGalleryMetaControl)
			$this->objParentObject = $objParentObject;

			// Setup linked ProjectGallery object
			$this->objProjectGallery = $objProjectGallery;

			// Figure out if we're Editing or Creating New
			if ($this->objProjectGallery->__Restored) {
				$this->strTitleVerb = QApplication::Translate('Edit');
				$this->blnEditMode = true;
			} else {
				$this->strTitleVerb = QApplication::Translate('Create');
				$this->blnEditMode = false;
			}
		 }

		/**
		 * Static Helper Method to Create using PK arguments
		 * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
		 * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
		 * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to
		 * edit, or if we are also allowed to create a new one, etc.
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this ProjectGalleryMetaControl
		 * @param integer $intId primary key value
		 * @param QMetaControlCreateType $intCreateType rules governing ProjectGallery object creation - defaults to CreateOrEdit
 		 * @return ProjectGalleryMetaControl
		 */
		public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			// Attempt to Load from PK Arguments
			if (strlen($intId)) {
				$objProjectGallery = ProjectGallery::Load($intId);

				// ProjectGallery was found -- return it!
				if ($objProjectGallery)
					return new ProjectGalleryMetaControl($objParentObject, $objProjectGallery);

				// If CreateOnRecordNotFound not specified, throw an exception
				else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
					throw new QCallerException('Could not find a ProjectGallery object with PK arguments: ' . $intId);

			// If EditOnly is specified, throw an exception
			} else if ($intCreateType == QMetaControlCreateType::EditOnly)
				throw new QCallerException('No PK arguments specified');

			// If we are here, then we need to create a new record
			return new ProjectGalleryMetaControl($objParentObject, new ProjectGallery());
		}

		/**
		 * Static Helper Method to Create using PathInfo arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this ProjectGalleryMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing ProjectGallery object creation - defaults to CreateOrEdit
		 * @return ProjectGalleryMetaControl
		 */
		public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::PathInfo(0);
			return ProjectGalleryMetaControl::Create($objParentObject, $intId, $intCreateType);
		}

		/**
		 * Static Helper Method to Create using QueryString arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this ProjectGalleryMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing ProjectGallery object creation - defaults to CreateOrEdit
		 * @return ProjectGalleryMetaControl
		 */
		public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::QueryString('intId');
			return ProjectGalleryMetaControl::Create($objParentObject, $intId, $intCreateType);
		}



		///////////////////////////////////////////////
		// PUBLIC CREATE and REFRESH METHODS
		///////////////////////////////////////////////

		/**
		 * Create and setup QLabel lblId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblId_Create($strControlId = null) {
			$this->lblId = new QLabel($this->objParentObject, $strControlId);
			$this->lblId->Name = QApplication::Translate('Id');
			if ($this->blnEditMode)
				$this->lblId->Text = $this->objProjectGallery->Id;
			else
				$this->lblId->Text = 'N/A';
			return $this->lblId;
		}

		/**
		 * Create and setup QListBox lstProject
		 * @param string $strControlId optional ControlId to use
		 * @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself
		 * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query
		 * @return QListBox
		 */
		public function lstProject_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) {
			$this->lstProject = new QListBox($this->objParentObject, $strControlId);
			$this->lstProject->Name = QApplication::Translate('Project');
			$this->lstProject->Required = true;
			if (!$this->blnEditMode)
				$this->lstProject->AddItem(QApplication::Translate('- Select One -'), null);

			// Setup and perform the Query
			if (is_null($objCondition)) $objCondition = QQ::All();
			$objProjectCursor = Project::QueryCursor($objCondition, $objOptionalClauses);

			// Iterate through the Cursor
			while ($objProject = Project::InstantiateCursor($objProjectCursor)) {
				$objListItem = new QListItem($objProject->__toString(), $objProject->Id);
				if (($this->objProjectGallery->Project) && ($this->objProjectGallery->Project->Id == $objProject->Id))
					$objListItem->Selected = true;
				$this->lstProject->AddItem($objListItem);
			}

			// Return the QListBox
			return $this->lstProject;
		}

		/**
		 * Create and setup QLabel lblProjectId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblProjectId_Create($strControlId = null) {
			$this->lblProjectId = new QLabel($this->objParentObject, $strControlId);
			$this->lblProjectId->Name = QApplication::Translate('Project');
			$this->lblProjectId->Text = ($this->objProjectGallery->Project) ? $this->objProjectGallery->Project->__toString() : null;
			$this->lblProjectId->Required = true;
			return $this->lblProjectId;
		}

		/**
		 * Create and setup QTextBox txtDescription
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtDescription_Create($strControlId = null) {
			$this->txtDescription = new QTextBox($this->objParentObject, $strControlId);
			$this->txtDescription->Name = QApplication::Translate('Description');
			$this->txtDescription->Text = $this->objProjectGallery->Description;
			$this->txtDescription->Required = true;
			$this->txtDescription->TextMode = QTextMode::MultiLine;
			return $this->txtDescription;
		}

		/**
		 * Create and setup QLabel lblDescription
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblDescription_Create($strControlId = null) {
			$this->lblDescription = new QLabel($this->objParentObject, $strControlId);
			$this->lblDescription->Name = QApplication::Translate('Description');
			$this->lblDescription->Text = $this->objProjectGallery->Description;
			$this->lblDescription->Required = true;
			return $this->lblDescription;
		}

		/**
		 * Create and setup QTextBox txtInternal
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtInternal_Create($strControlId = null) {
			$this->txtInternal = new QTextBox($this->objParentObject, $strControlId);
			$this->txtInternal->Name = QApplication::Translate('Internal');
			$this->txtInternal->Text = $this->objProjectGallery->Internal;
			$this->txtInternal->Required = true;
			$this->txtInternal->MaxLength = ProjectGallery::InternalMaxLength;
			return $this->txtInternal;
		}

		/**
		 * Create and setup QLabel lblInternal
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblInternal_Create($strControlId = null) {
			$this->lblInternal = new QLabel($this->objParentObject, $strControlId);
			$this->lblInternal->Name = QApplication::Translate('Internal');
			$this->lblInternal->Text = $this->objProjectGallery->Internal;
			$this->lblInternal->Required = true;
			return $this->lblInternal;
		}

		/**
		 * Create and setup QTextBox txtUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtUrl_Create($strControlId = null) {
			$this->txtUrl = new QTextBox($this->objParentObject, $strControlId);
			$this->txtUrl->Name = QApplication::Translate('Url');
			$this->txtUrl->Text = $this->objProjectGallery->Url;
			$this->txtUrl->Required = true;
			$this->txtUrl->MaxLength = ProjectGallery::UrlMaxLength;
			return $this->txtUrl;
		}

		/**
		 * Create and setup QLabel lblUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblUrl_Create($strControlId = null) {
			$this->lblUrl = new QLabel($this->objParentObject, $strControlId);
			$this->lblUrl->Name = QApplication::Translate('Url');
			$this->lblUrl->Text = $this->objProjectGallery->Url;
			$this->lblUrl->Required = true;
			return $this->lblUrl;
		}

		/**
		 * Create and setup QTextBox txtSecureUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtSecureUrl_Create($strControlId = null) {
			$this->txtSecureUrl = new QTextBox($this->objParentObject, $strControlId);
			$this->txtSecureUrl->Name = QApplication::Translate('Secure Url');
			$this->txtSecureUrl->Text = $this->objProjectGallery->SecureUrl;
			$this->txtSecureUrl->MaxLength = ProjectGallery::SecureUrlMaxLength;
			return $this->txtSecureUrl;
		}

		/**
		 * Create and setup QLabel lblSecureUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblSecureUrl_Create($strControlId = null) {
			$this->lblSecureUrl = new QLabel($this->objParentObject, $strControlId);
			$this->lblSecureUrl->Name = QApplication::Translate('Secure Url');
			$this->lblSecureUrl->Text = $this->objProjectGallery->SecureUrl;
			return $this->lblSecureUrl;
		}

		/**
		 * Create and setup QTextBox txtThumbUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtThumbUrl_Create($strControlId = null) {
			$this->txtThumbUrl = new QTextBox($this->objParentObject, $strControlId);
			$this->txtThumbUrl->Name = QApplication::Translate('Thumb Url');
			$this->txtThumbUrl->Text = $this->objProjectGallery->ThumbUrl;
			$this->txtThumbUrl->Required = true;
			$this->txtThumbUrl->MaxLength = ProjectGallery::ThumbUrlMaxLength;
			return $this->txtThumbUrl;
		}

		/**
		 * Create and setup QLabel lblThumbUrl
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblThumbUrl_Create($strControlId = null) {
			$this->lblThumbUrl = new QLabel($this->objParentObject, $strControlId);
			$this->lblThumbUrl->Name = QApplication::Translate('Thumb Url');
			$this->lblThumbUrl->Text = $this->objProjectGallery->ThumbUrl;
			$this->lblThumbUrl->Required = true;
			return $this->lblThumbUrl;
		}

		/**
		 * Create and setup QIntegerTextBox txtWidth
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtWidth_Create($strControlId = null) {
			$this->txtWidth = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtWidth->Name = QApplication::Translate('Width');
			$this->txtWidth->Text = $this->objProjectGallery->Width;
			$this->txtWidth->Required = true;
			return $this->txtWidth;
		}

		/**
		 * Create and setup QLabel lblWidth
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblWidth_Create($strControlId = null, $strFormat = null) {
			$this->lblWidth = new QLabel($this->objParentObject, $strControlId);
			$this->lblWidth->Name = QApplication::Translate('Width');
			$this->lblWidth->Text = $this->objProjectGallery->Width;
			$this->lblWidth->Required = true;
			$this->lblWidth->Format = $strFormat;
			return $this->lblWidth;
		}

		/**
		 * Create and setup QIntegerTextBox txtHeight
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtHeight_Create($strControlId = null) {
			$this->txtHeight = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtHeight->Name = QApplication::Translate('Height');
			$this->txtHeight->Text = $this->objProjectGallery->Height;
			$this->txtHeight->Required = true;
			return $this->txtHeight;
		}

		/**
		 * Create and setup QLabel lblHeight
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblHeight_Create($strControlId = null, $strFormat = null) {
			$this->lblHeight = new QLabel($this->objParentObject, $strControlId);
			$this->lblHeight->Name = QApplication::Translate('Height');
			$this->lblHeight->Text = $this->objProjectGallery->Height;
			$this->lblHeight->Required = true;
			$this->lblHeight->Format = $strFormat;
			return $this->lblHeight;
		}

		/**
		 * Create and setup QTextBox txtFormat
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtFormat_Create($strControlId = null) {
			$this->txtFormat = new QTextBox($this->objParentObject, $strControlId);
			$this->txtFormat->Name = QApplication::Translate('Format');
			$this->txtFormat->Text = $this->objProjectGallery->Format;
			$this->txtFormat->Required = true;
			$this->txtFormat->MaxLength = ProjectGallery::FormatMaxLength;
			return $this->txtFormat;
		}

		/**
		 * Create and setup QLabel lblFormat
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblFormat_Create($strControlId = null) {
			$this->lblFormat = new QLabel($this->objParentObject, $strControlId);
			$this->lblFormat->Name = QApplication::Translate('Format');
			$this->lblFormat->Text = $this->objProjectGallery->Format;
			$this->lblFormat->Required = true;
			return $this->lblFormat;
		}

		/**
		 * Create and setup QIntegerTextBox txtSize
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtSize_Create($strControlId = null) {
			$this->txtSize = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtSize->Name = QApplication::Translate('Size');
			$this->txtSize->Text = $this->objProjectGallery->Size;
			$this->txtSize->Required = true;
			return $this->txtSize;
		}

		/**
		 * Create and setup QLabel lblSize
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblSize_Create($strControlId = null, $strFormat = null) {
			$this->lblSize = new QLabel($this->objParentObject, $strControlId);
			$this->lblSize->Name = QApplication::Translate('Size');
			$this->lblSize->Text = $this->objProjectGallery->Size;
			$this->lblSize->Required = true;
			$this->lblSize->Format = $strFormat;
			return $this->lblSize;
		}

		/**
		 * Create and setup QTextBox txtLogUser
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtLogUser_Create($strControlId = null) {
			$this->txtLogUser = new QTextBox($this->objParentObject, $strControlId);
			$this->txtLogUser->Name = QApplication::Translate('Log User');
			$this->txtLogUser->Text = $this->objProjectGallery->LogUser;
			$this->txtLogUser->MaxLength = ProjectGallery::LogUserMaxLength;
			return $this->txtLogUser;
		}

		/**
		 * Create and setup QLabel lblLogUser
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblLogUser_Create($strControlId = null) {
			$this->lblLogUser = new QLabel($this->objParentObject, $strControlId);
			$this->lblLogUser->Name = QApplication::Translate('Log User');
			$this->lblLogUser->Text = $this->objProjectGallery->LogUser;
			return $this->lblLogUser;
		}

		/**
		 * Create and setup QDateTimePicker calLogInsert
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calLogInsert_Create($strControlId = null) {
			$this->calLogInsert = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calLogInsert->Name = QApplication::Translate('Log Insert');
			$this->calLogInsert->DateTime = $this->objProjectGallery->LogInsert;
			$this->calLogInsert->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calLogInsert;
		}

		/**
		 * Create and setup QLabel lblLogInsert
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblLogInsert_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblLogInsert = new QLabel($this->objParentObject, $strControlId);
			$this->lblLogInsert->Name = QApplication::Translate('Log Insert');
			$this->strLogInsertDateTimeFormat = $strDateTimeFormat;
			$this->lblLogInsert->Text = sprintf($this->objProjectGallery->LogInsert) ? $this->objProjectGallery->LogInsert->qFormat($this->strLogInsertDateTimeFormat) : null;
			return $this->lblLogInsert;
		}

		protected $strLogInsertDateTimeFormat;


		/**
		 * Create and setup QLabel lblLogUpdate
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblLogUpdate_Create($strControlId = null) {
			$this->lblLogUpdate = new QLabel($this->objParentObject, $strControlId);
			$this->lblLogUpdate->Name = QApplication::Translate('Log Update');
			if ($this->blnEditMode)
				$this->lblLogUpdate->Text = $this->objProjectGallery->LogUpdate;
			else
				$this->lblLogUpdate->Text = 'N/A';
			return $this->lblLogUpdate;
		}



		/**
		 * Refresh this MetaControl with Data from the local ProjectGallery object.
		 * @param boolean $blnReload reload ProjectGallery from the database
		 * @return void
		 */
		public function Refresh($blnReload = false) {
			if ($blnReload)
				$this->objProjectGallery->Reload();

			if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objProjectGallery->Id;

			if ($this->lstProject) {
					$this->lstProject->RemoveAllItems();
				if (!$this->blnEditMode)
					$this->lstProject->AddItem(QApplication::Translate('- Select One -'), null);
				$objProjectArray = Project::LoadAll();
				if ($objProjectArray) foreach ($objProjectArray as $objProject) {
					$objListItem = new QListItem($objProject->__toString(), $objProject->Id);
					if (($this->objProjectGallery->Project) && ($this->objProjectGallery->Project->Id == $objProject->Id))
						$objListItem->Selected = true;
					$this->lstProject->AddItem($objListItem);
				}
			}
			if ($this->lblProjectId) $this->lblProjectId->Text = ($this->objProjectGallery->Project) ? $this->objProjectGallery->Project->__toString() : null;

			if ($this->txtDescription) $this->txtDescription->Text = $this->objProjectGallery->Description;
			if ($this->lblDescription) $this->lblDescription->Text = $this->objProjectGallery->Description;

			if ($this->txtInternal) $this->txtInternal->Text = $this->objProjectGallery->Internal;
			if ($this->lblInternal) $this->lblInternal->Text = $this->objProjectGallery->Internal;

			if ($this->txtUrl) $this->txtUrl->Text = $this->objProjectGallery->Url;
			if ($this->lblUrl) $this->lblUrl->Text = $this->objProjectGallery->Url;

			if ($this->txtSecureUrl) $this->txtSecureUrl->Text = $this->objProjectGallery->SecureUrl;
			if ($this->lblSecureUrl) $this->lblSecureUrl->Text = $this->objProjectGallery->SecureUrl;

			if ($this->txtThumbUrl) $this->txtThumbUrl->Text = $this->objProjectGallery->ThumbUrl;
			if ($this->lblThumbUrl) $this->lblThumbUrl->Text = $this->objProjectGallery->ThumbUrl;

			if ($this->txtWidth) $this->txtWidth->Text = $this->objProjectGallery->Width;
			if ($this->lblWidth) $this->lblWidth->Text = $this->objProjectGallery->Width;

			if ($this->txtHeight) $this->txtHeight->Text = $this->objProjectGallery->Height;
			if ($this->lblHeight) $this->lblHeight->Text = $this->objProjectGallery->Height;

			if ($this->txtFormat) $this->txtFormat->Text = $this->objProjectGallery->Format;
			if ($this->lblFormat) $this->lblFormat->Text = $this->objProjectGallery->Format;

			if ($this->txtSize) $this->txtSize->Text = $this->objProjectGallery->Size;
			if ($this->lblSize) $this->lblSize->Text = $this->objProjectGallery->Size;

			if ($this->txtLogUser) $this->txtLogUser->Text = $this->objProjectGallery->LogUser;
			if ($this->lblLogUser) $this->lblLogUser->Text = $this->objProjectGallery->LogUser;

			if ($this->calLogInsert) $this->calLogInsert->DateTime = $this->objProjectGallery->LogInsert;
			if ($this->lblLogInsert) $this->lblLogInsert->Text = sprintf($this->objProjectGallery->LogInsert) ? $this->objProjectGallery->LogInsert->qFormat($this->strLogInsertDateTimeFormat) : null;

			if ($this->lblLogUpdate) if ($this->blnEditMode) $this->lblLogUpdate->Text = $this->objProjectGallery->LogUpdate;

		}



		///////////////////////////////////////////////
		// PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
		///////////////////////////////////////////////





		///////////////////////////////////////////////
		// PUBLIC PROJECTGALLERY OBJECT MANIPULATORS
		///////////////////////////////////////////////

		/**
		 * This will save this object's ProjectGallery instance,
		 * updating only the fields which have had a control created for it.
		 */
		public function SaveProjectGallery() {
			try {
				// Update any fields for controls that have been created
				if ($this->lstProject) $this->objProjectGallery->ProjectId = $this->lstProject->SelectedValue;
				if ($this->txtDescription) $this->objProjectGallery->Description = $this->txtDescription->Text;
				if ($this->txtInternal) $this->objProjectGallery->Internal = $this->txtInternal->Text;
				if ($this->txtUrl) $this->objProjectGallery->Url = $this->txtUrl->Text;
				if ($this->txtSecureUrl) $this->objProjectGallery->SecureUrl = $this->txtSecureUrl->Text;
				if ($this->txtThumbUrl) $this->objProjectGallery->ThumbUrl = $this->txtThumbUrl->Text;
				if ($this->txtWidth) $this->objProjectGallery->Width = $this->txtWidth->Text;
				if ($this->txtHeight) $this->objProjectGallery->Height = $this->txtHeight->Text;
				if ($this->txtFormat) $this->objProjectGallery->Format = $this->txtFormat->Text;
				if ($this->txtSize) $this->objProjectGallery->Size = $this->txtSize->Text;
				if ($this->txtLogUser) $this->objProjectGallery->LogUser = $this->txtLogUser->Text;
				if ($this->calLogInsert) $this->objProjectGallery->LogInsert = $this->calLogInsert->DateTime;

				// Update any UniqueReverseReferences (if any) for controls that have been created for it

				// Save the ProjectGallery object
				$this->objProjectGallery->Save();

				// Finally, update any ManyToManyReferences (if any)
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * This will DELETE this object's ProjectGallery instance from the database.
		 * It will also unassociate itself from any ManyToManyReferences.
		 */
		public function DeleteProjectGallery() {
			$this->objProjectGallery->Delete();
		}



		///////////////////////////////////////////////
		// PUBLIC GETTERS and SETTERS
		///////////////////////////////////////////////

		/**
		 * Override method to perform a property "Get"
		 * This will get the value of $strName
		 *
		 * @param string $strName Name of the property to get
		 * @return mixed
		 */
		public function __get($strName) {
			switch ($strName) {
				// General MetaControlVariables
				case 'ProjectGallery': return $this->objProjectGallery;
				case 'TitleVerb': return $this->strTitleVerb;
				case 'EditMode': return $this->blnEditMode;

				// Controls that point to ProjectGallery fields -- will be created dynamically if not yet created
				case 'IdControl':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'IdLabel':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'ProjectIdControl':
					if (!$this->lstProject) return $this->lstProject_Create();
					return $this->lstProject;
				case 'ProjectIdLabel':
					if (!$this->lblProjectId) return $this->lblProjectId_Create();
					return $this->lblProjectId;
				case 'DescriptionControl':
					if (!$this->txtDescription) return $this->txtDescription_Create();
					return $this->txtDescription;
				case 'DescriptionLabel':
					if (!$this->lblDescription) return $this->lblDescription_Create();
					return $this->lblDescription;
				case 'InternalControl':
					if (!$this->txtInternal) return $this->txtInternal_Create();
					return $this->txtInternal;
				case 'InternalLabel':
					if (!$this->lblInternal) return $this->lblInternal_Create();
					return $this->lblInternal;
				case 'UrlControl':
					if (!$this->txtUrl) return $this->txtUrl_Create();
					return $this->txtUrl;
				case 'UrlLabel':
					if (!$this->lblUrl) return $this->lblUrl_Create();
					return $this->lblUrl;
				case 'SecureUrlControl':
					if (!$this->txtSecureUrl) return $this->txtSecureUrl_Create();
					return $this->txtSecureUrl;
				case 'SecureUrlLabel':
					if (!$this->lblSecureUrl) return $this->lblSecureUrl_Create();
					return $this->lblSecureUrl;
				case 'ThumbUrlControl':
					if (!$this->txtThumbUrl) return $this->txtThumbUrl_Create();
					return $this->txtThumbUrl;
				case 'ThumbUrlLabel':
					if (!$this->lblThumbUrl) return $this->lblThumbUrl_Create();
					return $this->lblThumbUrl;
				case 'WidthControl':
					if (!$this->txtWidth) return $this->txtWidth_Create();
					return $this->txtWidth;
				case 'WidthLabel':
					if (!$this->lblWidth) return $this->lblWidth_Create();
					return $this->lblWidth;
				case 'HeightControl':
					if (!$this->txtHeight) return $this->txtHeight_Create();
					return $this->txtHeight;
				case 'HeightLabel':
					if (!$this->lblHeight) return $this->lblHeight_Create();
					return $this->lblHeight;
				case 'FormatControl':
					if (!$this->txtFormat) return $this->txtFormat_Create();
					return $this->txtFormat;
				case 'FormatLabel':
					if (!$this->lblFormat) return $this->lblFormat_Create();
					return $this->lblFormat;
				case 'SizeControl':
					if (!$this->txtSize) return $this->txtSize_Create();
					return $this->txtSize;
				case 'SizeLabel':
					if (!$this->lblSize) return $this->lblSize_Create();
					return $this->lblSize;
				case 'LogUserControl':
					if (!$this->txtLogUser) return $this->txtLogUser_Create();
					return $this->txtLogUser;
				case 'LogUserLabel':
					if (!$this->lblLogUser) return $this->lblLogUser_Create();
					return $this->lblLogUser;
				case 'LogInsertControl':
					if (!$this->calLogInsert) return $this->calLogInsert_Create();
					return $this->calLogInsert;
				case 'LogInsertLabel':
					if (!$this->lblLogInsert) return $this->lblLogInsert_Create();
					return $this->lblLogInsert;
				case 'LogUpdateControl':
					if (!$this->lblLogUpdate) return $this->lblLogUpdate_Create();
					return $this->lblLogUpdate;
				case 'LogUpdateLabel':
					if (!$this->lblLogUpdate) return $this->lblLogUpdate_Create();
					return $this->lblLogUpdate;
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

		/**
		 * Override method to perform a property "Set"
		 * This will set the property $strName to be $mixValue
		 *
		 * @param string $strName Name of the property to set
		 * @param string $mixValue New value of the property
		 * @return mixed
		 */
		public function __set($strName, $mixValue) {
			try {
				switch ($strName) {
					// Controls that point to ProjectGallery fields
					case 'IdControl':
						return ($this->lblId = QType::Cast($mixValue, 'QControl'));
					case 'ProjectIdControl':
						return ($this->lstProject = QType::Cast($mixValue, 'QControl'));
					case 'DescriptionControl':
						return ($this->txtDescription = QType::Cast($mixValue, 'QControl'));
					case 'InternalControl':
						return ($this->txtInternal = QType::Cast($mixValue, 'QControl'));
					case 'UrlControl':
						return ($this->txtUrl = QType::Cast($mixValue, 'QControl'));
					case 'SecureUrlControl':
						return ($this->txtSecureUrl = QType::Cast($mixValue, 'QControl'));
					case 'ThumbUrlControl':
						return ($this->txtThumbUrl = QType::Cast($mixValue, 'QControl'));
					case 'WidthControl':
						return ($this->txtWidth = QType::Cast($mixValue, 'QControl'));
					case 'HeightControl':
						return ($this->txtHeight = QType::Cast($mixValue, 'QControl'));
					case 'FormatControl':
						return ($this->txtFormat = QType::Cast($mixValue, 'QControl'));
					case 'SizeControl':
						return ($this->txtSize = QType::Cast($mixValue, 'QControl'));
					case 'LogUserControl':
						return ($this->txtLogUser = QType::Cast($mixValue, 'QControl'));
					case 'LogInsertControl':
						return ($this->calLogInsert = QType::Cast($mixValue, 'QControl'));
					case 'LogUpdateControl':
						return ($this->lblLogUpdate = QType::Cast($mixValue, 'QControl'));
					default:
						return parent::__set($strName, $mixValue);
				}
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}
	}
?>